gtkimcontextsimpleseqs.h \
gtkintl.h \
gtkkeyhash.h \
+ gtklockbuttonprivate.h \
gtkmenubuttonprivate.h \
gtkmenuprivate.h \
gtkmenuitemprivate.h \
#include "config.h"
-#include <string.h>
-#include <gtk/gtk.h>
+#include "gtk/gtklockbuttonprivate.h"
#include "gtklockbuttonaccessible.h"
G_DEFINE_TYPE (GtkLockButtonAccessible, _gtk_lock_button_accessible, GTK_TYPE_BUTTON_ACCESSIBLE)
+static const gchar *
+gtk_lock_button_accessible_get_name (AtkObject *obj)
+{
+ GtkLockButton *lockbutton;
+
+ lockbutton = GTK_LOCK_BUTTON (gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)));
+ if (lockbutton == NULL)
+ return NULL;
+
+ return _gtk_lock_button_get_current_text (lockbutton);
+}
+
static void
_gtk_lock_button_accessible_class_init (GtkLockButtonAccessibleClass *klass)
{
+ AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
+
+ atk_object_class->get_name = gtk_lock_button_accessible_get_name;
}
static void
#include "config.h"
-#include "gtklockbutton.h"
+#include "gtklockbuttonprivate.h"
#include "gtkbox.h"
#include "gtkimage.h"
#include "gtklabel.h"
g_object_notify (G_OBJECT (button), "permission");
}
}
+
+const char *
+_gtk_lock_button_get_current_text (GtkLockButton *button)
+{
+ GtkLockButtonPrivate *priv;
+
+ g_return_val_if_fail (GTK_IS_LOCK_BUTTON (button), NULL);
+
+ priv = button->priv;
+
+ if (gtk_widget_get_visible (priv->label_lock))
+ return gtk_label_get_text (GTK_LABEL (priv->label_lock));
+ else
+ return gtk_label_get_text (GTK_LABEL (priv->label_unlock));
+}
+
--- /dev/null
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Red Hat, Inc.
+ * Author: Matthias Clasen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GTK_LOCK_BUTTON_PRIVATE_H__
+#define __GTK_LOCK_BUTTON_PRIVATE_H__
+
+#include "gtklockbutton.h"
+
+G_BEGIN_DECLS
+
+const char * _gtk_lock_button_get_current_text (GtkLockButton *button);
+
+G_END_DECLS
+
+#endif /* __GTK_LOCK_BUTTON_PRIVATE_H__ */